package com.biglead.demo.utils;


import org.apache.commons.lang3.StringUtils;

import java.util.regex.Pattern;

/**
 * 校验工具类
 */
public class ValidatorUtil {

    private static final Pattern mobile_pattern = Pattern.compile("[1]([3-9])[0-9]{9}$");

    /**
     * 校验手机号码是否正确
     * @param mobile 手机号码
     * @return
     */
    public static boolean isMobile(String mobile) {
        if (StringUtils.isEmpty(mobile)) {
            return false;
        }
        return mobile_pattern.matcher(mobile).matches();
    }

}
